package com.thekernel.youdaoyun.controller;

import com.thekernel.youdaoyun.YoudaoyunApplication;
import com.thekernel.youdaoyun.bean.User;
import com.thekernel.youdaoyun.exception.MyException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @Author TheKernel
 * @Date 2019/9/16 3:01 下午
 * @Version 1.0
 * @Description 测试 UserController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = YoudaoyunApplication.class)
public class testUserController {

    @Autowired
    private UserController userController;

    @Test
    public void testLogin() throws MyException {
        User user = new User();  // 测试用户
        user.setUsername("1711090325");  // 测试用户名
        user.setPassword("990621");  // 测试用户密码

        String response = userController.userLogin(user);
        System.out.println(response);
    }

}
